class Solution {//leetcode518——零钱兑换II
public:
    int change(int amount, vector<int>& coins) {
        int n=coins.size();
        vector<double> dp(amount+1);
        dp[0]=1;

        for(int i=1;i<n+1;i++){
            for(int j=coins[i-1];j<amount+1;j++){
                dp[j]=dp[j]+dp[j-coins[i-1]];
            }
        }
        return dp[amount];
    }
};